<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="./scripts/jquery/jquery-1.7.1.js"></script>
<link href="./style/authority/basic_layout.css" rel="stylesheet" type="text/css">
<link href="./style/authority/common_style.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="./scripts/authority/commonAll.js"></script>
<script type="text/javascript" src="./scripts/fancybox/jquery.fancybox-1.3.4.js"></script>
<script type="text/javascript" src="./scripts/fancybox/jquery.fancybox-1.3.4.pack.js"></script>
<link rel="stylesheet" type="text/css" href="./style/authority/jquery.fancybox-1.3.4.css" media="screen"></link>
<script type="text/javascript" src="./scripts/artDialog/artDialog.js?skin=default"></script>
<title>活动管理</title>
<script type="text/javascript">
	$(document).ready(function(){
		/** 新增   **/
	    $("#addBtn").fancybox({
	    	'href'  : '/SSH2/toaddActivity',
	    	'width' : 733,
	        'height' : 530,
	        'type' : 'iframe',
	        'hideOnOverlayClick' : false,
	        'showCloseButton' : true,
	        'onClosed' : function() { 
	        	    window.location.href = '/SSH2/admin_allActivity';
	        }
	    });
		
	    /**编辑   **/
	    $("a.edit").fancybox({
	    	'width' : 733,
	        'height' : 530,
	        'type' : 'iframe',
	        'hideOnOverlayClick' : false,
	        'showCloseButton' : true,
	        'onClosed' : function() { 
	        	window.location.href = '';
	        }
	    });
	});
	/** 用户角色   **/
	var userRole = '';

	/** 模糊查询  **/
	function search(){
		var nameValue = document.getElementById("fyZldz").value;
		if(nameValue == null || nameValue==""){
			alert("输入不能为空！");
			return;
			
		}
		$("#submitForm").attr("action", "/SSH2/admin_allActivity?name="+nameValue).submit();
	}

	/** 新增   **/
	function add(){
		$("#submitForm").attr("action", "").submit();	
	}
	
	/** 删除 **/
	function del(fyID){
		// 非空判断
		if(fyID == "") return;
		if(confirm("您确定要删除吗？")){
			$("#submitForm").attr("action", "/SSH2/deleteActivity?messageId=" + fyID).submit();			
		}
	}
	
	function showAll(){
		$("#submitForm").attr("action", "/SSH2/admin_allActivity").submit();
	}
</script>
<style>
	.alt td{ background:black !important;}
</style>
</head>
<body>
	<form id="submitForm" name="submitForm" action="" method="post">
		<input type="hidden" name="allIDCheck" value="" id="allIDCheck"/>
		<input type="hidden" name="fangyuanEntity.fyXqName" value="" id="fyXqName"/>
		<div id="container">
			<div class="ui_content">
				<div class="ui_text_indent">
					<div id="box_border">
						<div id="box_top">搜索</div>
						<div id="box_center">
							活动标题关键字：
							&nbsp;&nbsp;<input type="text" id="fyZldz" class="ui_input_txt02" />
						</div>
						<div id="box_bottom">
						    <input type="button" value="所有" class="ui_input_btn01" onclick="showAll();" /> 
							<input type="button" value="查询" class="ui_input_btn01" onclick="search();" /> 
							<input type="button" value="新增" class="ui_input_btn01" id="addBtn" /> 
						</div>
					</div>
				</div>
			</div>
			<div class="ui_content">
				<div class="ui_tb">
				<c:if test="${empty requestScope.activityList}">没有活动信息</c:if>
				<c:if test="${!empty requestScope.activityList}">
					<table class="table" cellspacing="0" cellpadding="0" width="100%" align="center" border="0">
						<tr>
							<!-- <th width="30"><input type="checkbox" id="all" onclick="selectOrClearAllCheckbox(this);" />
							</th> -->
							<th>活动标题</th>
							<th>内容</th>
							<th>图片</th>
							<th>操作</th>
						</tr>
						<c:forEach items="${requestScope.activityList}" var="activity">
							<tr>
								<td>${activity.getTitle() }</td>
								<td style="max-width: 300px;">${activity.getTexts() }</td>
								<td><img src="${activity.getImageUrl() }" style="height:50px;padding-top:5px;"/></td>
								<td>
									<a href="/SSH2/editActivity?activity_id=${activity.getActivity_id() }" class="edit">编辑</a> 
									<a href="javascript:del('${activity.getActivity_id() }');">删除</a>
								</td>
							</tr>
						</c:forEach>
					</table>
				</c:if>
				</div>
				<!-- <div class="ui_tb_h30">
					<div class="ui_flt" style="height: 30px; line-height: 30px;">
						共有
						<span class="ui_txt_bold04">90</span>
						条记录，当前第
						<span class="ui_txt_bold04">1
						/
						9</span>
						页
					</div>
					<div class="ui_frt">
						   如果是第一页，则只显示下一页、尾页
						
							<input type="button" value="首页" class="ui_input_btn01" />
							<input type="button" value="上一页" class="ui_input_btn01" />
							<input type="button" value="下一页" class="ui_input_btn01"
								onclick="jumpNormalPage(2);" />
							<input type="button" value="尾页" class="ui_input_btn01"
								onclick="jumpNormalPage(9);" />
						
						
						
						    如果是最后一页，则只显示首页、上一页
						
						转到第<input type="text" id="jumpNumTxt" class="ui_input_txt01" />页
							 <input type="button" class="ui_input_btn01" value="跳转" onclick="jumpInputPage(9);" />
					</div> -->
				</div>
			</div>
		</div>
	</form>
<div style="display:none"><script src='http://v7.cnzz.com/stat.php?id=155540&web_id=155540' language='JavaScript' charset='gb2312'></script></div>
</body>
</html>
